package com.atguigu;

public class MyThread extends Thread{
    int ticket = 50; //代表票数
    @Override
    public void run() {
        if (ticket>0) {
            ticket--;
            System.out.println(Thread.currentThread().getName() + "买到票,剩余票数" + ticket);
        }
    }
}
